'use strict';

const { log } = require("console");

exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log("getcertDetail - 参数",JSON.stringify(event));
	const db = uniCloud.database();
	const collection = db.collection('certDetail');
	let list = [];
	// 推荐
	if(event.typeId === 0){
		 list = await collection.limit(10).skip(event.count).get();
	}else{
		 list = await collection.limit(10).skip(event.count).where({"typeId":event.typeId}).get();
	}
	console.log("videoDetail - list",list);
	//返回数据给客户端
	return list
};
